<template>
	<view class="mainPage">
		<!-- <view class="tip">备注：激活后商品只能换货不能退货</view> -->
		<view class="form-box">
			<view class="form-tit">
				激活金额
			</view>
			<view class="input-box"><u-input v-model="activateFee" :type="type" placeholder="请输入金额" :custom-style="customStyle"/></view>
			<view class="tip-two">可激活金额：{{activateBalance}}</view>
		</view>
		<view class="btn" @tap="sureSubmit">确定</view>
	</view>
</template>

<script>
	import {
		shopMallImgUrl
	} from "@/common/config.js"
	import {
		getStoreData,
		setStoreData,
		httpGet,
		httpPost
	} from "@/utils/http.js";
	export default {
		data() {
			return {
				activateFee:"",
				user_info:{},
				type: 'number',
				activateBalance:"",
				customStyle: {
					'font-weight': 'bold',
					'font-size': '48rpx'
				},
			}
		},
		onLoad(option) {
			
		},
		onShow() {
		
		},
		
		methods: {
			sureSubmit() {
				const _this = this;
				if(this.activateFee>this.activateBalance){
					uni.showToast({
						title: '输入金额不能超出可提现金额',
						duration: 2000
					});
					return
				}
				if(this.activateFee%500!=0){
					uni.showToast({
						title: '激活金额必须是500的整数倍',
						duration: 2000
					});
					return
				}
				
				httpPost("/api/userwallet/info")
					.then((res) => {
						uni.showToast({
							title: '激活成功'
						})
					})
					.catch((e) => {
						//
					});
				
			}
		}
	}
</script>

<style lang="scss">
	.mainPage {
		background-color: #efefef;
		height:calc(100vh - 20rpx);
		padding-top: 20rpx;
	.tip{
		padding-top: 20rpx;
		padding-bottom: 20rpx;
		padding-left: 30rpx;
		padding-right: 30rpx;
		background-color: #f5b8c3;
		color: #E42548;
		font-size: 28rpx;
		font-weight: bold;
	}
	.form-box{
		margin-left: 30rpx;
		margin-right: 30rpx;
		background-color: #fff;
		border-radius: 20rpx;
		padding: 20rpx;
		
		.form-tit{
			font-size: 24rpx;
			color: #c3c3c3;
		}
		.tip-two{
			font-size: 24rpx;
		}
		.input-box{
			border-bottom: 2rpx solid #efefef;
			margin-bottom: 20rpx;
		}
	}
	.btn{
		padding-top: 20rpx;
		padding-bottom: 20rpx;
		margin-left: 30rpx;
		margin-right: 30rpx;
		padding-right: 30rpx;
		background: linear-gradient(to right, #FFA858, #E42548);
		color: #fff;
		text-align: center;
		border-radius: 20rpx;
		margin-top: 20rpx;
	}
	}

	
</style>